﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Adminitrator.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="admin_Partners_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
  <h3 class="title">Danh sách đối tác</h3>
  <div class="view">
    <div class="search">
      <table width="100%">
        <tr>
          <td>
            <label>Tình trạng</label>
             <asp:DropDownList ID="dropIsEnable" runat="server" CssClass="dropDown" 
              Width="100px" AutoPostBack="True" 
              onselectedindexchanged="dropIsEnable_SelectedIndexChanged" >
               <asp:ListItem Value="0">Tất cả</asp:ListItem>
               <asp:ListItem Value="1">Bật</asp:ListItem>
               <asp:ListItem Value="2">Tắt</asp:ListItem>
            </asp:DropDownList>
          </td>
          <td align="right">
            <asp:Button runat="server" ID="btnXoaChon" Text="Xóa chọn" CssClass="btnXoaChon" 
              onclick="btnXoaChon_Click" /> &nbsp;
            <asp:Button runat="server" ID="btnEnable" Text="Hiển thị" CssClass="btnHienThi"
              onclick="btnEnable_Click" />&nbsp;
            <asp:Button runat="server" ID="btnVisible" Text="  Ẩn  " CssClass="btnAn" 
              onclick="btnVisible_Click" />
          </td>
        </tr>
      </table>
    </div>
    <div class="gridView">
      <asp:GridView ID="gridView" runat="server" Width="780px" 
        AutoGenerateColumns="False" CellPadding="3" EnableModelValidation="True" 
        GridLines="None" AllowPaging="True" BackColor="White" BorderColor="White" 
        BorderStyle="Ridge" BorderWidth="2px" CellSpacing="1" 
        onrowdatabound="gridView_RowDataBound" 
        onpageindexchanging="gridView_PageIndexChanging" PageSize="8" 
        onrowdeleting="gridView_RowDeleting" EmptyDataText="Dữ liệu trống !" 
        onrowcommand="gridView_RowCommand">
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <HeaderStyle BackColor="#4581BB" Font-Bold="True" ForeColor="#E7E7FF" 
          Height="30px" HorizontalAlign="Left" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" 
          CssClass="page" />
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" CssClass="row-item" />
        <SelectedRowStyle BackColor="#990000" Font-Bold="True" ForeColor="White" 
          Font-Underline="True" />
        <Columns>
          <asp:TemplateField HeaderText="Chọn">
            <ItemTemplate>
              <asp:CheckBox ID="checkBox" runat="server" />
            </ItemTemplate>
            <ItemStyle Width="30px" />
          </asp:TemplateField>
          <asp:BoundField DataField="Id" HeaderText="ID">
          <ItemStyle Width="30px" />
          </asp:BoundField>
          <asp:BoundField DataField="Name" HeaderText="Tên">
          <ItemStyle Width="190px" />
          </asp:BoundField>
          <asp:TemplateField HeaderText="Link">
            <ItemTemplate>
              <a href='<%#Eval("Link") %>' target="_blank"><%#Eval("Link") %></a>
            </ItemTemplate>
            <ItemStyle Width="190px" />
          </asp:TemplateField>
            <asp:ButtonField CommandName="Down" ImageUrl="~/Images/icon-down.png">
          <ItemStyle Width="15px" CssClass="linkDown" />
          </asp:ButtonField>
          <asp:ButtonField ImageUrl="~/Images/icon-up.png" CommandName="Up">
          <ItemStyle Width="15px" CssClass="linkUp" />
          </asp:ButtonField>
          <asp:ImageField DataImageUrlField="Image" 
            DataImageUrlFormatString="~/Images/Partner/{0}" HeaderText="Ảnh">
            <ControlStyle Height="30px" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Height="30px" HorizontalAlign="Center" Width="50px" />
          </asp:ImageField>
          
          <asp:TemplateField HeaderText="Tình trạng">
            <ItemTemplate>
              <asp:Image ID="imgStates" runat="server" />
            </ItemTemplate>
            <ItemStyle Width="70px" />
          </asp:TemplateField>
          
          <asp:HyperLinkField DataNavigateUrlFields="Id" 
            DataNavigateUrlFormatString="~/admin/Partners/Details.aspx?Id={0}" 
            HeaderText="Sửa" >
          <ItemStyle CssClass="btnEdit" Width="16px" />
          </asp:HyperLinkField>
          <asp:TemplateField HeaderText="Xóa">
            <ItemTemplate>
              <asp:LinkButton ID="linkDelete" runat="server" CausesValidation="false" Text="" CssClass="btnDelete"
              CommandName="Delete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa ?')">
              </asp:LinkButton>
            </ItemTemplate>
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
    </div>
    <div style="margin-top: 10px">
      <asp:LinkButton ID="linkCheckAll" runat="server" Text="Chọn tất cả" 
        onclick="linkCheckAll_Click" />&nbsp; &nbsp; &nbsp;
       <asp:LinkButton ID="linkUnCheckAll" runat="server" Text="Bỏ chọn tất cả" 
        onclick="linkUnCheckAll_Click" />
    </div>
  </div>
  <asp:Literal ID="lbThongBao" runat="server"  />
</asp:Content>

